package com.interview.javabase.algorithm;

import org.junit.Test;
import org.springframework.boot.test.context.SpringBootTest;

/**
 * @description:
 * @author: zhangshuguang@vichain.com
 * @date: 2019/06/12 15:19
 */
@SpringBootTest
public class Demo3 {

    @Test
    public void solution1() {
        String s = "leetcode";

        String aa = "aeiou";
        char[] chars = s.toCharArray();
        for (int i = 0; i < chars.length / 2; i++) {
            if (aa.indexOf(chars[i]) > 0 && aa.indexOf(chars[chars.length - i - 1]) > 0) {
                System.out.println(chars[i] + "-" + chars[chars.length - i - 1]);
                char a = chars[i];
                chars[i] = chars[chars.length - i - 1];
                chars[chars.length - i - 1] = a;
            }
        }

        System.out.println(String.valueOf(chars));
    }
}
